<template>
	<div class="publicpageview">
		<div class="publicformview">
			<el-form :inline="true" :model="listQuery" size="mini" ref="searchForm">
				<el-row :gutter="25">
					<el-col :span="5">
						<el-form-item label="区房屋管理单位：" prop="areaUnit">
							<el-select clearable v-model="listQuery.areaUnit" @change='areaChange'>
								<div v-for="(item,index) in areaList" :key="index">
									<el-option :label="item.dname" :value="item.did" :key="index"></el-option>
								</div>
							</el-select>
						</el-form-item>
					</el-col>
					<el-col :span="5">
						<el-form-item label="管理部(分中心)：" prop="houseAdmin">
							<el-select clearable v-model="listQuery.houseAdmin" @change='HouseChange'>
								<div v-for="(item,index) in HouseList" :key="index">
					
									<el-option :label="item.aname" :value="item.aid" :key="index"></el-option>
								</div>
							</el-select>
						</el-form-item>
					</el-col>
					<el-col :span="5">
						<el-form-item label="承租人：" prop="renter">
							<el-input clearable v-model="listQuery.renter"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="5">
						<el-form-item label="购房人：" prop="buyer">
							<el-input clearable v-model="listQuery.buyer"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="5">
						<el-form-item label="所号：" prop="blockNo">
							<el-input clearable v-model="listQuery.blockNo"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="5">
						<el-form-item label="地址：" prop="address">
							<el-input clearable v-model="listQuery.address"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="5">
						<el-form-item label="审核状态：" prop="ApprovalNo">
							<el-input clearable v-model="listQuery.ApprovalNo"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="日期范围开始：" prop="startTime">
							<el-date-picker clearable v-model="listQuery.startTime" type="date" placeholder="年/月/日">
							</el-date-picker>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="日期范围结束：" prop="endTime">
							<el-date-picker clearable v-model="listQuery.endTime" type="date" placeholder="年/月/日">
							</el-date-picker>
						</el-form-item>
					</el-col>
					<!-- <el-col :span="6">
						<el-form-item label="出售类型：" prop="status">
							<el-select v-model="listQuery.status">
								<el-option label="正常" value="正常" key="1"></el-option>
								<el-option label="置换后" value="置换后" key="0"></el-option>
							</el-select>
						</el-form-item>
					</el-col> -->
					<el-col :span="5">
						<div>
							<el-button size="mini" type="primary" @click="sumbitCx">查询</el-button>
							<el-button size="mini" @click="resetTop">重置</el-button>
						</div>
					</el-col>
				</el-row>
			</el-form>
		</div>

		<div class="publitableview">
			<el-button type="primary" size="mini" @click="handleUpdate('',1)">售房信息录入</el-button>
			<el-table v-loading="listLoading" :data="list" border fit highlight-current-row size="mini">

				<el-table-column align="center" label="承租人" prop="renter">
				</el-table-column>

				<el-table-column align="center" label="承租合同" prop="contractid">
				</el-table-column>

				<el-table-column align="center" label="购房人" prop="buyer">
				</el-table-column>

				<el-table-column align="center" label="身份证号" prop="buyeridno">
				</el-table-column>

				<el-table-column align="center" label="工作单位" prop="buyercorp">
				</el-table-column>

				<el-table-column align="center" label="所档号" prop="blockno">
				</el-table-column>

				<el-table-column align="center" label="辖区" prop="district">
				</el-table-column>

		<!-- 		<el-table-column align="center" label="地址" prop="address">
				</el-table-column> -->

				<el-table-column align="center" label="操作" width="280">
					<template slot-scope="scope">
						<el-button type="text" size="mini" @click="handleTijiao(scope.row,5)">提交</el-button>
						<el-button type="text" size="mini" @click="shenheOpen(scope.row.buyerid,4)">审核</el-button>
						<el-button type="text" size="mini" @click="handleUpdate(scope.row.buyerid,2)">修改</el-button>
						<el-button type="text" size="mini" @click="handleUpdate(scope.row.buyerid,3)">详情</el-button>
						<el-button type="text" size="mini" @click="handleDelete(scope.row.buyerid)">删除</el-button>
					</template>
				</el-table-column>
			</el-table>

			<div class="publicpaginationview">
				<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
					:current-page="listQuery.pageNum" background :page-sizes="[10, 20, 50, 100]" :page-size="listQuery.pageSize"
					layout="total, sizes, prev, pager, next, jumper" :total="total" small></el-pagination>
			</div>
		</div>

		<!-- 弹窗部分 -->
		<el-dialog :title="type==1?'售房信息录入':type==2?'售房信息修改':'售房信息详情'"
			:visible.sync="dialogVisible" width="80%" :before-close="handleClose" style="margin-top: 20px;">
			<el-form :model="addQuery" :disabled='type==3' ref="dataForm" class="demo-ruleForm" label-position="right" label-width="100px">
				<el-row :gutter="24">
					<el-col :span="6">
						<el-form-item label="审批号：" prop="sph">
							<el-input v-model="sph"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="承租人：" prop="renter">
							<el-input v-model="addQuery.renter"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="租赁合同：" prop="contractid">
							<el-input v-model="addQuery.contractid"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="发生日期：" prop="selldate">
							<!-- <el-input v-model="addQuery.selldate"></el-input> -->
							<el-date-picker v-model="addQuery.selldate" type="date" placeholder="年/月/日">
							</el-date-picker>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="购房人：" prop="buyer">
							<el-input v-model="addQuery.buyer"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="身份证号：" prop="buyeridno">
							<el-input v-model="addQuery.buyeridno"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="发生性质：" prop="sellcause">
							<el-input v-model="addQuery.sellcause"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="共同使用人：" prop="buyer1">
							<el-input v-model="addQuery.buyer1"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="工作单位：" prop="buyercorp">
							<el-input v-model="addQuery.buyercorp"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="所档号：" prop="blockno">
							<el-input v-model="addQuery.blockno"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="房间区域：" prop="district">
							<el-input v-model="addQuery.district"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="地址：" prop="address">
							<el-input v-model="addQuery.address"></el-input>
						</el-form-item>
					</el-col>
				</el-row>
			</el-form>
			<div class="xinxi">
				<el-button @click="selectButton('购房资料分组')" :class="[typename=='购房资料分组'?'tabButton':'']" type="primary"
					size="medium ">购房资料分组</el-button>
				<el-button @click="selectButton('评估资料分组')" :class="[typename=='评估资料分组'?'tabButton':'']" type="primary"
					size="medium ">评估资料分组</el-button>
			</div>
			<div class="goufangContent" v-if="typename=='购房资料分组'">
				<el-form :model="addQuery" :disabled='type==3' ref="dataForm" class="demo-ruleForm" label-position="right" label-width="100px">
					<el-row :gutter="24">
						<el-col :span="6">
							<el-form-item label="售房单位：" prop="creatingdept">
								<el-input v-model="addQuery.creatingdept"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="地号：" prop="fieldno">
								<el-input v-model="addQuery.fieldno"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="单元号：" prop="apartmentno">
								<el-input v-model="addQuery.apartmentno"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="协议书号：" prop="agreementno">
								<el-input v-model="addQuery.agreementno"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="证件：" prop="estateidno">
								<el-input v-model="addQuery.estateidno"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="居室间数：" prop="roomcount">
								<el-input v-model="addQuery.roomcount"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="购房证明：" prop="certificateno">
								<el-input v-model="addQuery.certificateno"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="建筑形式：" prop="buildingform">
								<el-input v-model="addQuery.buildingform"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="计租间：" prop="roomrentcount">
								<el-input v-model="addQuery.roomrentcount"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="审批序号：" prop="approvalno">
								<el-input v-model="addQuery.approvalno"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="建筑结构：" prop="structuredetail">
								<el-input v-model="addQuery.structuredetail"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="不计租间：" prop="roomnotrentcount">
								<el-input v-model="addQuery.roomnotrentcount"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="经办人：" prop="sellagent">
								<el-input v-model="addQuery.sellagent"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="竣工年限：" prop="buildyear">
								<el-input v-model="addQuery.buildyear"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="租定金额：" prop="totalrent">
								<el-input v-model="addQuery.totalrent"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="评估人：" prop="sellassessor">
								<el-input v-model="addQuery.sellassessor"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="门号：" prop="buildingdoorno">
								<el-input v-model="addQuery.buildingdoorno"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="总楼层数：" prop="floorcount">
								<el-input v-model="addQuery.floorcount"></el-input>
							</el-form-item>
						</el-col>
					</el-row>
				</el-form>
			</div>
			
			<div class="goufangContent" v-if="typename=='评估资料分组'">
				<el-form :model="addQuery" :disabled='type==3' ref="dataForm" class="demo-ruleForm" label-position="right" label-width="130px">
					<el-row :gutter="20">
						<el-col :span="6">
							<el-form-item label="地级：" prop="addresslevelliving">
								<el-input v-model="addQuery.addresslevelliving"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="地级系数：" prop="addresslevelvalue">
								<el-input v-model="addQuery.addresslevelvalue"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="现住房折：" prop="nowlivingdiscount">
								<el-input v-model="addQuery.nowlivingdiscount"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="记租面积：" prop="rentarea">
								<el-input v-model="addQuery.rentarea"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="朝向：" prop="facingdirection">
								<el-input v-model="addQuery.facingdirection"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="朝向系数：" prop="facingdirectionvalue">
								<el-input v-model="addQuery.facingdirectionvalue"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="一次性折：" prop="onetimediscount">
								<el-input v-model="addQuery.onetimediscount"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="建筑面积：" prop="buildingarea">
								<el-input v-model="addQuery.buildingarea"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="楼层：" prop="floorno">
								<el-input v-model="addQuery.floorno"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="楼层系数：" prop="floorvalue">
								<el-input v-model="addQuery.floorvalue"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="应售价格：" prop="sellprice1">
								<el-input v-model="addQuery.sellprice1"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="计价面积：" prop="buildingareacalc">
								<el-input v-model="addQuery.buildingareacalc"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="工龄：" prop="workyear">
								<el-input v-model="addQuery.workyear"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="工龄折扣：" prop="workyeardiscount">
								<el-input v-model="addQuery.workyeardiscount"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="应售房价：" prop="sellprice2">
								<el-input v-model="addQuery.sellprice2"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="住房基金75.6%：" prop="p756">
								<el-input v-model="addQuery.p756"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="房龄：" prop="buildyearuse">
								<el-input v-model="addQuery.buildyearuse"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="房龄折扣：" prop="buildyeardiscount">
								<el-input v-model="addQuery.buildyeardiscount"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="实售房价：" prop="realsellprice">
								<el-input v-model="addQuery.realsellprice"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="14.40%：" prop="p144">
								<el-input v-model="addQuery.p144"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="执行：" prop="sellway">
								<el-input v-model="addQuery.sellway"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="执行单价：" prop="sellwayprice">
								<el-input v-model="addQuery.sellwayprice"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="电梯水泵资金：" prop="ppumpfund">
								<el-input v-model="addQuery.ppumpfund"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="售价1%：" prop="p1">
								<el-input v-model="addQuery.p1"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="售价10%：" prop="p10">
								<el-input v-model="addQuery.p10"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="合计：" prop="total101">
								<el-input v-model="addQuery.total101"></el-input>
							</el-form-item>
						</el-col>
					</el-row>
				</el-form>
			</div>
			<div class="saveContent">
				<el-button v-if="type==3" type="primary" @click="dialogVisible = false" size="medium">返回</el-button>
				<el-button v-else type="primary" @click="save" size="medium">保 存</el-button>
			</div>

		</el-dialog>
		
		
		<!-- 审核弹窗 -->
		<el-dialog title="售房信息审核"
			:visible.sync="shenheVisible" width="80%" :before-close="handleClose" style="margin-top: 20px;">
			<el-form :model="shenheQuery" disabled ref="dataForm" class="demo-ruleForm" label-position="right" label-width="160px">
				<el-row :gutter="20">
					<el-col :span="6">
						<el-form-item label="承租人：" prop="renter">
							<el-input v-model="shenheQuery.renter"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="产权证号：" prop="estateidno">
							<el-input v-model="shenheQuery.estateidno"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="房屋坐落：" prop="address">
							<el-input v-model="shenheQuery.address"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="购房人：" prop="buyer">
							<el-input v-model="shenheQuery.buyer"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="工作单位：" prop="buyercorp">
							<el-input v-model="shenheQuery.buyercorp"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="结构等级：" prop="structuredetail">
							<el-input v-model="shenheQuery.structuredetail"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="建筑面积 (发证面积)：" prop="buildingarea">
							<el-input v-model="shenheQuery.buildingarea"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="地段等级：" prop="addresslevelliving">
							<el-input v-model="shenheQuery.addresslevelliving"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="执行成本价：" prop="sellwayprice">
							<el-input v-model="shenheQuery.sellwayprice"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="朝向：" prop="facingdirection">
							<el-input v-model="shenheQuery.facingdirection"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="执行标准价：" prop="sellway">
							<el-input v-model="shenheQuery.sellway"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="房型：" prop="buildingform">
							<el-input v-model="shenheQuery.buildingform"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="记租面积：" prop="rentarea">
							<el-input v-model="shenheQuery.rentarea"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="总楼层：" prop="floorcount">
							<el-input v-model="shenheQuery.floorcount"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="计价建筑面积：" prop="buildingareacalc">
							<el-input v-model="shenheQuery.buildingareacalc"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="所在楼层：" prop="floorno">
							<el-input v-model="shenheQuery.floorno"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="应售价格：" prop="sellprice1">
							<el-input v-model="shenheQuery.sellprice1"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="应售房价：" prop="sellprice2">
							<el-input v-model="shenheQuery.sellprice2"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="应新折扣：" prop="buildyeardiscount">
							<el-input v-model="shenheQuery.buildyeardiscount"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="工龄合计：" prop="workyear">
							<el-input v-model="shenheQuery.workyear"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="一次性付款折扣：" prop="onetimediscount">
							<el-input v-model="shenheQuery.onetimediscount"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="实售房价：" prop="realsellprice">
							<el-input v-model="shenheQuery.realsellprice"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="工龄折扣：" prop="workyeardiscount">
							<el-input v-model="shenheQuery.workyeardiscount"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="经办人：" prop="sellagent">
							<el-input v-model="shenheQuery.sellagent"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="竣工年限：" prop="buildyear">
							<el-input v-model="shenheQuery.buildyear"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="租定金额：" prop="totalrent">
							<el-input v-model="shenheQuery.totalrent"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="评估人：" prop="sellassessor">
							<el-input v-model="shenheQuery.sellassessor"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="现住房折扣：" prop="nowlivingdiscount">
							<el-input v-model="shenheQuery.nowlivingdiscount"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="1%共用部位 维修基金：" prop="p1">
							<el-input v-model="shenheQuery.p1"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="6">
						<el-form-item label="合计金额：" prop="total101">
							<el-input v-model="shenheQuery.total101"></el-input>
						</el-form-item>
					</el-col>
				</el-row>
			</el-form>
			<div class="xinxi">
				<el-button @click="shenheButton('评估人意见')" :class="[shenheName=='评估人意见'?'tabButton':'']" type="primary"
					size="medium ">评估人意见</el-button>
				<el-button @click="shenheButton('售房单位意见')" :class="[shenheName=='售房单位意见'?'tabButton':'']" type="primary"
					size="medium ">售房单位意见</el-button>
				<el-button @click="shenheButton('市评估所意见')" :class="[shenheName=='市评估所意见'?'tabButton':'']" type="primary"
					size="medium ">市评估所意见</el-button>
				<el-button @click="shenheButton('局公司意见')" :class="[shenheName=='局公司意见'?'tabButton':'']" type="primary"
					size="medium ">局公司意见</el-button>
			</div>
			<div class="goufangContent" v-if="shenheName=='评估人意见'">
				<el-form :model="listQuery" ref="dataForm" class="demo-ruleForm" label-position="right" label-width="160px">
					<el-row :gutter="24">
						<el-col :span="6">
							<el-form-item label="评估人：" prop="keyword">
								<el-input v-model="listQuery.keyword"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="日期：" prop="keyword">
								<el-input v-model="listQuery.keyword"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="评估人意见：" prop="keyword">
								<el-input v-model="listQuery.keyword"></el-input>
							</el-form-item>
						</el-col>
					</el-row>
				</el-form>
			</div>
			<div class="goufangContent" v-if="shenheName=='售房单位意见'">
				<el-form :model="listQuery" ref="dataForm" class="demo-ruleForm" label-position="right" label-width="160px">
					<el-row :gutter="24">
						<el-col :span="6">
							<el-form-item label="负责人：" prop="keyword">
								<el-input v-model="listQuery.keyword"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="经办人：" prop="keyword">
								<el-input v-model="listQuery.keyword"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="售房单位意见：" prop="keyword">
								<el-input v-model="listQuery.keyword"></el-input>
							</el-form-item>
						</el-col>
					</el-row>
				</el-form>
			</div>
			<div class="goufangContent" v-if="shenheName=='市评估所意见'">
				<el-form :model="listQuery" ref="dataForm" class="demo-ruleForm" label-position="right" label-width="160px">
					<el-row :gutter="24">
						<el-col :span="6">
							<el-form-item label="日期：" prop="keyword">
								<el-input v-model="listQuery.keyword"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="市评估所意见：" prop="keyword">
								<el-input v-model="listQuery.keyword"></el-input>
							</el-form-item>
						</el-col>
					</el-row>
				</el-form>
			</div>
			<div class="goufangContent" v-if="shenheName=='局公司意见'">
				<el-form :model="listQuery" ref="dataForm" class="demo-ruleForm" label-position="right" label-width="160px">
					<el-row :gutter="24">
						<el-col :span="6">
							<el-form-item label="审核：" prop="keyword">
								<el-input v-model="listQuery.keyword"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="负责人：" prop="keyword">
								<el-input v-model="listQuery.keyword"></el-input>
							</el-form-item>
						</el-col>
						<el-col :span="6">
							<el-form-item label="经办人：" prop="keyword">
								<el-input v-model="listQuery.keyword"></el-input>
							</el-form-item>
						</el-col>
					</el-row>
				</el-form>
			</div>
			
			
			<div class="saveContent">
				<el-button v-if="type==3" type="primary" @click="shenheVisible = false" size="medium">返回</el-button>
				<el-button v-else type="primary" @click="shenheSave" size="medium">保 存</el-button>
			</div>
		
		</el-dialog>
	</div>
</template>

<script>
	import dayjs from 'dayjs'
	import {
		buyerList,
		getArea,
		getHouseAdmin,
		addBuyer,
		delBuyer,
		buyerData,
		updBuyer
	} from '@/api/industry'
	export default {
		name: "AccommodationManagementGonglingguanli",

		data() {
			return {
				listQuery: {
					pageNum: 1,
					pageSize: 20,
					address:'',
					ApprovalNo:'',
					blockNo:'',
					buyer:'',
					endTime:'',
					renter:'',
					startTime:'',
					houseAdmin:'',
					areaUnit:''
				},
				total: 0,
				options: [{
					key: "1"
				}],
				list: [],
				listLoading: false,
				dialogVisible: false,
				shenheVisible: false,
				shenheQuery: {
					renter:'',
					estateidno:'',
					address:'',
					buyer:'',
					buyercorp:'',
					structuredetail:'',
					buildingarea:'',
					addresslevelliving:'',
					sellwayprice:'',
					sellway:'',
					facingdirection:'',
					buildingform:'',
					rentarea:'',
					floorcount:'',
					buildingareacalc:'',
					floorno:'',
					sellprice1:'',
					sellprice2:'',
					buildyeardiscount:'',
					workyear:'',
					onetimediscount:'',
					realsellprice:'',
					workyeardiscount:'',
					sellagent:'',
					buildyear:'',
					totalrent:'',
					sellassessor:'',
					nowlivingdiscount:'',
					p1:'',
					total101:''
				},
				addQuery:{
					renter:'',
					contractid:'',
					selldate:'',
					buyer:'',
					buyeridno:'',
					sellcause:'',
					buyercorp:'',
					blockno:'',
					district:'',
					address:'',
					creatingdept:'',
					fieldno:'',
					apartmentno:'',
					agreementno:'',
					estateidno:'',
					roomcount:'',
					certificateno:'',
					buildingform:'',
					roomrentcount:'',
					approvalno:'',
					structuredetail:'',
					roomnotrentcount:'',
					sellagent:'',
					buildyearuse:'',
					totalrent:'',
					sellassessor:'',
					buildingdoorno:'',
					floorcount:'',
					addresslevelliving:'',
					addresslevelvalue:'',
					nowlivingdiscount:'',
					rentarea:'',
					facingdirection:'',
					facingdirectionvalue:'',
					onetimediscount:'',
					buildingarea:'',
					floorno:'',
					floorvalue:'',
					sellprice1:'',
					buyer1:'',
					buildingareacalc:'',
					workyear:'',
					workyeardiscount:'',
					sellprice2:'',
					p756:'',
					buildyear:'',
					buildyeardiscount:'',
					realsellprice:'',
					p144:'',
					sellway:'',
					sellwayprice:'',
					ppumpfund:'',
					p1:'',
					p10:'',
					total101:''
				},
				// 不穿数据
				gtsyr:'',
				sph:'',
				
				
				// --------------------
				type: '',
				typename: '购房资料分组',
				shenheName:'评估人意见',
				
				// 区房屋管理单位
				areaList: [],
				// 根据区获取部门
				HouseList: [],
				buyId:''
			};
		},

		computed: {
		},

		mounted() {
			this.getArea()
		},

		methods: {
			buyerList(){
				let data = {
					address:this.listQuery.address,
					ApprovalNo:this.listQuery.ApprovalNo,
					blockNo:this.listQuery.blockNo,
					buyer:this.listQuery.buyer,
					endTime:this.listQuery.endTime?String(dayjs(this.listQuery.endTime).format('YYYY-MM-DD HH:mm:ss')):"",
					renter:this.listQuery.renter,
					startTime:this.listQuery.startTime?String(dayjs(this.listQuery.startTime).format('YYYY-MM-DD HH:mm:ss')):'',
					pageNum:this.listQuery.pageNum,
					pageSize:this.listQuery.pageSize,
					houseAdmin:this.listQuery.houseAdmin
				}
				this.listLoading = true;
				buyerList(data).then(res=>{
					this.list = res.data.list
					this.total = res.data.total
					this.listLoading = false;
				})
			},
			getArea() {
				console.log(1)
				getArea().then(res => {
					console.log(res)
					this.areaList = res.data
				})
			},
			getHouseAdmin(e) {
				getHouseAdmin({
					DID: e
				}).then(res => {
					this.HouseList = res.data
				})
			},
			// 选择区房屋管理
			areaChange(e) {
				console.log(e)
				this.listQuery.areaUnit = e
				this.listQuery.houseAdmin = ''
				this.getHouseAdmin(e)
			},
			// 根据区获取部门
			HouseChange(e) {
				console.log(e)
				this.listQuery.houseAdmin = e
			},
			save(){
				let data = {
					renter:this.addQuery.renter,
					contractid:this.addQuery.contractid,
					selldate:String(dayjs(this.addQuery.selldate).format('YYYY-MM-DD HH:mm:ss')),
					buyer:this.addQuery.buyer,
					buyeridno:this.addQuery.buyeridno,
					sellcause:this.addQuery.sellcause,
					buyercorp:this.addQuery.buyercorp,
					blockno:this.addQuery.blockno,
					district:this.addQuery.district,
					address:this.addQuery.address,
					creatingdept:this.addQuery.creatingdept,
					fieldno:this.addQuery.fieldno,
					apartmentno:this.addQuery.apartmentno,
					agreementno:this.addQuery.agreementno,
					estateidno:this.addQuery.estateidno,
					roomcount:this.addQuery.roomcount,
					certificateno:this.addQuery.certificateno,
					buildingform:this.addQuery.buildingform,
					roomrentcount:this.addQuery.roomrentcount,
					approvalno:this.addQuery.approvalno,
					structuredetail:this.addQuery.structuredetail,
					roomnotrentcount:this.addQuery.roomnotrentcount,
					sellagent:this.addQuery.sellagent,
					buildyearuse:this.addQuery.buildyearuse,
					totalrent:this.addQuery.totalrent,
					sellassessor:this.addQuery.sellassessor,
					buildingdoorno:this.addQuery.buildingdoorno,
					floorcount:this.addQuery.floorcount,
					addresslevelliving:this.addQuery.addresslevelliving,
					addresslevelvalue:this.addQuery.addresslevelvalue,
					nowlivingdiscount:this.addQuery.nowlivingdiscount,
					rentarea:this.addQuery.rentarea,
					facingdirection:this.addQuery.facingdirection,
					facingdirectionvalue:this.addQuery.facingdirectionvalue,
					onetimediscount:this.addQuery.onetimediscount,
					buildingarea:this.addQuery.buildingarea,
					floorno:this.addQuery.floorno,
					floorvalue:this.addQuery.floorvalue,
					sellprice1:this.addQuery.sellprice1,
					buyer1:this.addQuery.buyer1,
					buildingareacalc:this.addQuery.buildingareacalc,
					workyear:this.addQuery.workyear,
					workyeardiscount:this.addQuery.workyeardiscount,
					sellprice2:this.addQuery.sellprice2,
					p756:this.addQuery.p756,
					buildyear:this.addQuery.buildyear,
					buildyeardiscount:this.addQuery.buildyeardiscount,
					realsellprice:this.addQuery.realsellprice,
					p144:this.addQuery.p144,
					sellway:this.addQuery.sellway,
					sellwayprice:this.addQuery.sellwayprice,
					ppumpfund:this.addQuery.ppumpfund,
					p1:this.addQuery.p1,
					p10:this.addQuery.p10,
					total101:this.addQuery.total101
				}
				if(this.type==2){
					data.buyId = this.buyId
					updBuyer(data).then(res=>{
						this.$message(res.message);
						this.dialogVisible = false
						this.popupreset()
					})
				}else{
					addBuyer(data).then(res=>{
						this.$message(res.message);
						this.dialogVisible = false
						this.popupreset()
					})
				}
				
			},
			// 重置弹窗
			popupreset() {
				this.addQuery.renter='',
				this.addQuery.contractid='',
				this.addQuery.selldate='',
				this.addQuery.buyer='',
				this.addQuery.buyeridno='',
				this.addQuery.sellcause='',
				this.addQuery.buyercorp='',
				this.addQuery.blockno='',
				this.addQuery.district='',
				this.addQuery.address='',
				this.addQuery.creatingdept='',
				this.addQuery.fieldno='',
				this.addQuery.apartmentno='',
				this.addQuery.agreementno='',
				this.addQuery.estateidno='',
				this.addQuery.roomcount='',
				this.addQuery.certificateno='',
			  this.addQuery.buildingform='',
				this.addQuery.roomrentcount='',
				this.addQuery.approvalno='',
				this.addQuery.structuredetail='',
				this.addQuery.roomnotrentcount='',
				this.addQuery.sellagent='',
				this.addQuery.buildyearuse='',
				this.addQuery.totalrent='',
				this.addQuery.sellassessor='',
				this.addQuery.buildingdoorno='',
				this.addQuery.floorcount='',
				this.addQuery.addresslevelliving='',
				this.addQuery.addresslevelvalue='',
				this.addQuery.nowlivingdiscount='',
				this.addQuery.rentarea='',
				this.addQuery.facingdirection='',
				this.addQuery.facingdirectionvalue='',
				this.addQuery.onetimediscount='',
				this.addQuery.buildingarea='',
				this.addQuery.floorno='',
				this.addQuery.floorvalue='',
				this.addQuery.sellprice1='',
				this.addQuery.buyer1='',
				this.addQuery.buildingareacalc='',
				this.addQuery.workyear='',
				this.addQuery.workyeardiscount='',
				this.addQuery.sellprice2='',
				this.addQuery.p756='',
				this.addQuery.buildyear='',
				this.addQuery.buildyeardiscount='',
				this.addQuery.realsellprice='',
				this.addQuery.p144='',
				this.addQuery.sellway='',
				this.addQuery.sellwayprice='',
				this.addQuery.ppumpfund='',
				this.addQuery.p1='',
				this.addQuery.p10='',
				this.addQuery.total101 = ''
				this.buyerList()
			},
			handleSizeChange(val) {
				this.listQuery.pageNum = 1;
				this.listQuery.pageSize = val;
				this.buyerList()
			},
			handleCurrentChange(val) {
				this.listQuery.pageNum = val;
				this.buyerList()
			},

			resetForm(val) {
				console.log("1");
				this.$refs[val].resetFields();
			},

			handleAddUser() {
				this.$router.push('chanquanziliaoluru')
			},
			handleUpdate(currentData, type) {
				//   一定要在打开弹窗前 再赋值 不然resetFiles没用
				this.type = type
				this.dialogVisible = true;
				this.$nextTick(() => {
					this.buyId = currentData
				});
				if (type == 3 || type == 2) {
					let data = {
						buyId: currentData
					}
					buyerData(data).then(res => {
						console.log(res)
						this.addQuery = res.data
					})
				}
			},
			shenheOpen(currentData){
				this.shenheVisible = true
				let data = {
					buyId: currentData
				}
				buyerData(data).then(res => {
					console.log(res)
					this.shenheQuery = res.data
				})
			},
			// 查询
			sumbitCx() {
					this.buyerList()
			},
			// 重置
			resetTop() {
					this.listQuery.pageNum=1,
					this.listQuery.pageSize= 20,
					this.listQuery.address='',
					this.listQuery.ApprovalNo='',
					this.listQuery.blockNo='',
					this.listQuery.buyer='',
					this.listQuery.endTime='',
					this.listQuery.renter='',
					this.listQuery.startTime=''			
			},
			handleDelete(e) {
				this.$confirm('此操作将删除该条内容，请确认是否继续操作？', '删除提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					let data = {
						buyId: e
					}
					delBuyer(data).then(res => {
						this.buyerList()
						this.$message({
							type: 'success',
							message: '删除成功!'
						});
					})
				}).catch(() => {
					this.$message({
						type: 'info',
						message: '已取消删除'
					});
				});
			},
			handleTijiao(){
				this.$confirm('请确认是否提交此条数据？', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					this.$message({
						type: 'success',
						message: '提交成功!'
					});
				}).catch(() => {
					this.$message({
						type: 'info',
						message: '已取消提交'
					});
				});
			},
			shenheSave(){
				this.$message({
					type: 'success',
					message: '字段缺失!'
				});
				this.shenheVisible = false
			},
			// 选择类型
			selectButton(type) {
				this.typename = type
			},
			shenheButton(type){
				this.shenheName = type
			},
			handleClose(done) {
				this.$confirm('确认关闭？')
					.then(_ => {
						done();
					})
					.catch(_ => {});
			}
		},
	};
</script>
<style scoped>
	.saveContent {
		width: 100%;
		display: flex;
		justify-content: end;
		margin-top: 20px;
		padding-bottom: 20px;
	}

	.title {
		color: #008C93;
		text-align: center;
		margin-bottom: 20px;
		font-weight: bold;
	}

	.cfguanpian {
		padding-bottom: 20px;
		color: #008C93;
		margin-bottom: 20px;
		font-weight: bold;
	}

	.title2 {
		color: #008C93;
		margin-bottom: 20px;
		font-weight: bold;
	}

	.tianjiaButton {
		border: 2px solid #008C93;
		background-color: #fff;
		color: #008C93;
	}
	.xinxi {
		display: flex;
		width: 800px;
	}
	.goufangContent{
		width: 100%;
		box-sizing: border-box;
		padding: 20px;
		background-color: #F7F7F7;
	}
	.tabButton {
		background: #EFF2F7;
		color: #333333;
		border: none;
	}
</style>